import { NetworkConfig } from '../types/types';

export const DEFAULT_NETWORKS: NetworkConfig[] = [
    {
        chainId: 1,
        name: 'Ethereum Mainnet',
        rpcUrl: 'https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161',
        symbol: 'ETH',
        explorer: 'https://etherscan.io'
    },
    {
        chainId: 5,
        name: 'Goerli Testnet',
        rpcUrl: 'https://goerli.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161',
        symbol: 'ETH',
        explorer: 'https://goerli.etherscan.io'
    },
    {
        chainId: 11155111,
        name: 'Sepolia Testnet',
        rpcUrl: 'https://sepolia.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161',
        symbol: 'ETH',
        explorer: 'https://sepolia.etherscan.io'
    },
    {
        chainId: 56,
        name: 'Binance Smart Chain',
        rpcUrl: 'https://bsc-dataseed.binance.org/',
        symbol: 'BNB',
        explorer: 'https://bscscan.com'
    },
    {
        chainId: 137,
        name: 'Polygon Mainnet',
        rpcUrl: 'https://polygon-rpc.com/',
        symbol: 'MATIC',
        explorer: 'https://polygonscan.com'
    },
    {
        chainId: 42161,
        name: 'Arbitrum One',
        rpcUrl: 'https://arb1.arbitrum.io/rpc',
        symbol: 'ETH',
        explorer: 'https://arbiscan.io'
    },
    {
        chainId: 10,
        name: 'Optimism',
        rpcUrl: 'https://mainnet.optimism.io',
        symbol: 'ETH',
        explorer: 'https://optimistic.etherscan.io'
    },
    {
        chainId: 2206132,
        name: 'PlatON',
        rpcUrl: 'https://devnet2openapi.platon.network/rpc',
        symbol: 'LAT',
        explorer: 'https://devnet2scan.platon.network/'
    }
];

export const getNetworkByChainId = (chainId: number): NetworkConfig | undefined => {
    return DEFAULT_NETWORKS.find(network => network.chainId === chainId);
};